#ifndef PLAYER_H
#define PLAYER_H

#include <QWidget>
#include"cards.h"
#include"card.h"

class Player : public QWidget
{
    Q_OBJECT
public:
    explicit Player(QWidget *parent = nullptr);
    //玩家的各类信息以及游戏策略
    //设置姓名
    explicit Player(const QString&name,QWidget *parent = nullptr);
    //设置性别等
    enum Sex{Man,Woman};
    enum Role{Farmer,Lander};
    enum Direction{Left,Right};
    enum Type{Robot,User};
    //设置与获取操作
    QString getName();
    void setSex(Sex sex);
    Sex getSex();
    void setRole(Role role);
    Role getRole();
    void setDiretion(Direction dire);
    Direction getDiretion();
    //设置分数和获取分数
    void setScore(int score);
    int  getScore();
    void setIswin(bool win);
    bool getIswin();
    //获取和设置上下家
    void setPrePlayer(Player*player);
    Player*getPrePlayer();
    void setNextPlayer(Player*player);
    Player*getNextPlayer();

    //根据点数抢地主
    void grapLander(int point);
    //存储牌：一张或者多张
    void storeDiapachCard(Card card);
    void storeDiapatchCards(Cards cards);
    //清空卡牌
    void clearCards();
    //得到所有的卡牌
    Cards* getCards();
    //记录出牌
    void  playCards(Cards cards);
    //记录和获取出牌者和出的牌
    void setPenCardInfo(Cards cards,Player*player);
    Player*getPenPlayer();
    Cards*getPenCards();
    //虚函数
    virtual void CallLander() = 0;
    virtual void PlayCard() = 0;
signals:
protected:
    QString m_name;
    Sex m_sex;
    Role m_role;
    Direction m_dire;
    Type type;
    int  m_score;
    bool IsWin;
    //上下家
    Player*PrePlayer;
    Player*NestPlayer;
    //记录我的卡牌和发出去的卡牌
    Cards m_cards;
    Cards m_Pencards;
    Player*m_PenPlayer;
};

#endif // PLAYER_H
